package com.china08.yxyapi.repository.mg.lecture;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.lecture.YxyLectureCatalog;

/**
 * @author Richard.Wang
 * @descript 备授课目录
 */
@Transactional
public interface YxyLectureCatalogRepository extends MongoRepository<YxyLectureCatalog, String> {

    public YxyLectureCatalog findByIdAndUserIdAndSchoolId(String id, String userId, String schoolId);

    /**
     * @param userId
     * @param schoolId
     * @return
     */
    public List<YxyLectureCatalog> findByUserIdAndSchoolIdAndStatusOrderByIsDefaultDesc(String userId, String schoolId,
            Integer status);

    public List<YxyLectureCatalog> findByUserIdAndSchoolId(String userId, String schoolId);

    public YxyLectureCatalog findById(String id);

    int countByUserIdAndSchoolId(String userId, String schoolId);

    public List<YxyLectureCatalog> findByUserIdAndSchoolIdAndIsDefault(String userId, String schoolId, int i);

    public long countByUserIdAndSchoolIdAndBookId(String userId, String schoolId, String bookId);

    public YxyLectureCatalog findByUserIdAndSchoolIdAndBookId(String userId, String schoolId, String bookId);

}
